<div class="container page-container" style="padding-bottom: 1em">
    <?php
        $con = explode('-', $this->session->userdata('con_priv'));
        if($con[1]==0){
    ?>
    <div class="page-header">
        <h2><span class="glyphicon glyphicon-earphone"></span> Contact</h2>
    </div>
    <ul class="nav nav-tabs">
        <li class="active emp-nav"><a href="#employees-tab" data-toggle="tab">Employee</a></li>
        <li class="client-nav"><a href="#clients-tab" data-toggle="tab">Client</a></li>
        <li class="supplier-nav"><a href="#supplier-tab" data-toggle="tab">Supplier</a></li>
    </ul>
    <div class="tab-content contacts-container">
        <!--Employees-->
        <div class="tab-pane active" id="employees-tab">
            <div class="container employee-filter">
                <div class="row">
                    <?php if($con[0]==0){?>
                    <div class="col-md-2">
                        <a href="#new-emp-popup" role="button" data-toggle="modal" 
                           data-backdrop="static" data-keyboard="false" class="btn btn-primary">
                            <span class="glyphicon glyphicon-plus"></span> New Employee</a>
                    </div>
                    <?php } ?>
                    <?php if($con[3]==0) {?>
                    <div class="col-md-3">
                        <a href="#delete-emp-popup"class="btn btn-default btn-delete-emp hide-element" data-toggle="modal" title="Delete Emploee/s">
                            <span class="glyphicon glyphicon-trash"></span> Delete
                        </a>
                    </div>
                    <?php }?>
                </div>
            </div>
            <div class="table-responsive">
                <table id="employees-table" class="table table-bordered table-hover emp-list">
                    <thead>  
                        <tr>  
                            <th style="width: 1%;"><input type="checkbox" class="check-all-emp"/></th>
                            <th style="width: 15%;">Employee Name</th>
                            <th style="width: 5%;">Gender</th>
                            <th>Address</th>
                            <th style="width: 20%;">Email</th>
                            <th style="width: 10%;">Contact No.</th>
                            <th style="width: 10%;">Date Employed</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if($employees === FALSE){?>
                        <?php }else{ ?>
                            <?php foreach ($employees as $employee) { ?>
                            <tr>
                                <td><input type="checkbox" class="item-emp-checkbox emp-id" value="<?php echo $employee['coordinator_id']?>"/></td>
                                <td><a href="#view-emp-popup" class="btn-view-emp" data-toggle="modal" 
                                       data-backdrop="static" data-keyboard="false"><?php echo $employee['name']?></a></td>  
                                <td><?php if($employee['coord_gender']=='0'){echo 'Male';}else{echo 'Female';}?></td>
                                <td><?php echo $employee['coord_address']?></td>
                                <td><?php echo $employee['coord_email']?></td>
                                <td><?php echo $employee['coord_num']?></td>
                                <td><?php echo $employee['emp_date']?></td>
                            </tr>
                            <?php } ?>
                        <?php } ?>
                    </tbody>  
                </table>
            </div>
            <!--New Employee Modal-->
            <?php if($con[0]==0){?>
            <div class="modal fade" id="new-emp-popup" tabindex="-1" role="dialog" aria-labelledby="new-emp" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="new-emp">New Employee</h4>
                        </div>
                        <div class="modal-body">
                            <form id="emp-form" method="post" class="new-emp-container">
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-lname" class="control-label">Last Name</label>
                                        <input type="text" name="lname" class="form-control lname" />
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-fname" class="control-label">First Name</label>
                                        <input type="text" name="fname" class="form-control fname" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-mname" class="control-label">Middle Name</label>
                                        <input type="text" name="mname" class="form-control mname" />
                                    </div>
                                    <div class="col-sm-6">
                                        <label>Gender</label><br/>
                                        <div class="btn-group gender" data-toggle="buttons">
                                            <label class="btn btn-default active">
                                                <input type="radio" name="gender" value="0" checked>Male
                                            </label>
                                            <label class="btn btn-default">
                                                <input type="radio" name="gender" value="1">Female
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-bday" class="control-label">Birthday</label>
                                        <div class="form-inline bday">
                                            <div class="form-group">
                                                <select class="form-control bday-month required select" name="bday_month">
                                                    <option class="default-month" value="">Month</option>
                                                    <option value="1">Jan</option>
                                                <option value="2">Feb</option>
                                                <option value="3">Mar</option>
                                                <option value="4">Apr</option>
                                                <option value="5">May</option>
                                                <option value="6">Jun</option>
                                                <option value="7">Jul</option>
                                                <option value="8">Aug</option>
                                                <option value="9">Sep</option>
                                                <option value="10">Oct</option>
                                                <option value="11">Nov</option>
                                                <option value="12">Dec</option>
                                                </select>
                                            </div>
                                            <div class="form-group">
                                                <select class="form-control bday-day required select" name="bday_day">
                                                    <option class="default-day" value="">Day</option>
                                                    <?php $day = 1; while($day!=32){  ?>
                                                        <option value="<?php echo $day?>"><?php echo $day?></option>
                                                    <?php $day++; }?>
                                                </select>
                                            </div>
                                            <div class="form-group">
                                                <select class="form-control bday-year required select" name="bday_year">
                                                    <option class="default-year" value="">Year</option>
                                                    <?php $year = date('Y'); while($year!=1850){  ?>
                                                        <option value="<?php echo $year?>"><?php echo $year?></option>
                                                    <?php $year--; }?>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-date-emp" class="control-label">Date Employed</label>
                                        <input type="date" name="date_emp" class="form-control date-emp" placeholder="yyyy-mm-dd" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 address-container">
                                        <label for="n-address" class="control-label">Address</label>
                                        <input type="text" class="form-control address-text address-1" name="address_1">
                                        <input type="text" class="form-control address-text address-2" name="address_2">
                                        <input type="text" class="form-control address-text address-3" name="address_3">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 email-container">
                                        <label for="n-email" class="control-label">Email Address</label>
                                        <input type="text" class="form-control email-text email-1" name="email_1">
                                        <input type="text" class="form-control email-text email-2" name="email_2">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 contact-no-container">
                                        <label for="n-contact-no" class="control-label">Contact No.</label>
                                        <input type="text" class="form-control contact-no-text contact-1" name="contact_no_1">
                                        <input type="text" class="form-control contact-no-text contact-2" name="contact_no_2">
                                        <input type="text" class="form-control contact-no-text contact-3" name="contact_no_3">
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                    <input type="submit" role="button" class="btn btn-primary btn-save" value="Save"/>
                                </div>
                                <div class="clearfix"></div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <?php } ?>
            <!--View Employee Modal-->
            <div class="modal fade" id="view-emp-popup" tabindex="-1" role="dialog" aria-labelledby="view-emp" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="view-emp">View Employee</h4>
                            <button class="btn btn-default btn-edit-emp margin-top"><span class="glyphicon glyphicon-edit"></span> Edit</button>
                        </div>
                        <div class="modal-body">
                            <input type="hidden" name="emp_id" id="emp-id" />
                            <div class="view-emp-container">
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Name</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="name"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Birthday</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="bday"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Gender</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="gender"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Address</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="address"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Email Address</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="email"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Contact Number</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="contact"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <form id="emp-edit-form" method="post" class="edit-emp-container hide">
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-lname" class="control-label">Last Name</label>
                                        <input type="text" name="lname" class="form-control lname" />
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-fname" class="control-label">First Name</label>
                                        <input type="text" name="fname" class="form-control fname" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-mname" class="control-label">Middle Name</label>
                                        <input type="text" name="mname" class="form-control mname" />
                                    </div>
                                    <div class="col-sm-6">
                                        <label>Gender</label><br/>
                                        <div class="btn-group gender" data-toggle="buttons">
                                            <label class="btn btn-default active">
                                                <input type="radio" name="gender" value="0" checked>Male
                                            </label>
                                            <label class="btn btn-default">
                                                <input type="radio" name="gender" value="1">Female
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-bday" class="control-label">Birthday</label>
                                        <div class="form-inline bday">
                                            <div class="form-group">
                                                <select class="form-control bday-month required select" name="bday_month">
                                                    <option class="default-month" value="">Month</option>
                                                    <option value="1">Jan</option>
                                                <option value="2">Feb</option>
                                                <option value="3">Mar</option>
                                                <option value="4">Apr</option>
                                                <option value="5">May</option>
                                                <option value="6">Jun</option>
                                                <option value="7">Jul</option>
                                                <option value="8">Aug</option>
                                                <option value="9">Sep</option>
                                                <option value="10">Oct</option>
                                                <option value="11">Nov</option>
                                                <option value="12">Dec</option>
                                                </select>
                                            </div>
                                            <div class="form-group">
                                                <select class="form-control bday-day required select" name="bday_day">
                                                    <option class="default-day" value="">Day</option>
                                                    <?php $day = 1; while($day!=32){  ?>
                                                        <option value="<?php echo $day?>"><?php echo $day?></option>
                                                    <?php $day++; }?>
                                                </select>
                                            </div>
                                            <div class="form-group">
                                                <select class="form-control bday-year required select" name="bday_year">
                                                    <option class="default-year" value="">Year</option>
                                                    <?php $year = date('Y'); while($year!=1850){  ?>
                                                        <option value="<?php echo $year?>"><?php echo $year?></option>
                                                    <?php $year--; }?>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-date-emp" class="control-label">Date Employed</label>
                                        <input type="date" name="date_emp" class="form-control date-emp" placeholder="yyyy-mm-dd" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 address-container">
                                        <label for="v-address" class="control-label">Address</label>
                                        <input type="text" class="form-control address-text address-1" name="address_1">
                                        <input type="text" class="form-control address-text address-2" name="address_2">
                                        <input type="text" class="form-control address-text address-3" name="address_3">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 email-container">
                                        <label for="v-email" class="control-label">Email Address</label>
                                        <input type="text" class="form-control email-text email-1" name="email_1">
                                        <input type="text" class="form-control email-text email-2" name="email_2">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 contact-no-container">
                                        <label for="v-contact-no" class="control-label">Contact No.</label>
                                        <input type="text" class="form-control contact-no-text contact-1" name="contact_no_1">
                                        <input type="text" class="form-control contact-no-text contact-2" name="contact_no_2">
                                        <input type="text" class="form-control contact-no-text contact-3" name="contact_no_3">
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                    <input type="submit" role="button" class="btn btn-primary btn-update" value="Update"/>
                                </div>
                                <div class="clearfix"></div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <!--Delete Employee Modal-->
            <?php if($con[3]==0) { ?>
            <div class="modal fade" id="delete-emp-popup" tabindex="-1" role="dialog" aria-labelledby="delete-emp" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="delete-emp">Delete Employee/s</h4>
                        </div>
                        <div class="modal-body">
                            <h4>Are you sure you want to delete the checked items?</h4>
                            <p><b>Note: </b>This action cannot be undone.</p>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default btn-no" data-dismiss="modal">No</button>
                            <button type="button" class="btn btn-primary btn-yes">Yes</button>
                        </div>
                  </div>
                </div>
            </div>
            <?php } ?>
        </div>
        <!--Client-->
        <div class="tab-pane" id="clients-tab">
            <div class="container client-filter">
                <div class="row">
                    <?php if($con[0]==0){?>
                    <div class="col-md-2">
                        <div class="btn-group">
                            <a href="#new-client-popup" role="button" data-toggle="modal" 
                               data-backdrop="static" data-keyboard="false" class="btn btn-primary">
                                <span class="glyphicon glyphicon-plus"></span> New Client</a>
                        </div>
                    </div>
                    <?php } ?>
                    <?php if($con[3]==0) {?>
                    <div class="col-md-3">
                        <a href="#delete-client-popup" class="btn btn-default btn-delete-client hide-element" data-toggle="modal" title="Delete Client/s">
                            <span class="glyphicon glyphicon-trash"></span> Delete
                        </a>
                    </div>
                    <?php } ?>
                </div>
            </div>
            <div class="table-responsive">
                <table id="clients-table" class="table table-bordered table-hover client-list">
                    <thead>  
                        <tr>  
                            <th style="width: 1%;"><input type="checkbox" class="check-all-client"/></th>
                            <th style="width: 15%;">Client Name</th>
                            <th>Address</th>
                            <th style="width: 20%;">Email</th>
                            <th style="width: 10%;">Contact No.</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if($clients === FALSE){?>
                        <?php }else{ ?>
                            <?php foreach ($clients as $client) {?>
                            <tr>
                                <td><input type="checkbox" class="item-client-checkbox" value="<?php echo $client['client_id']?>"/></td>
                                <td><a href="#view-client-popup" class="btn-view-client" data-toggle="modal" 
                                       data-backdrop="static" data-keyboard="false"><?php echo $client['name']?></a></td>
                                <td><?php echo $client['client_address']?></td>
                                <td><?php echo $client['client_email']?></td>
                                <td><?php echo $client['client_num']?></td>
                            </tr>
                            <?php } ?>
                        <?php } ?>
                    </tbody>  
                </table>
            </div>
            <!--New Client Modal-->
            <?php if($con[0]==0){?>
            <div class="modal fade" id="new-client-popup" tabindex="-1" role="dialog" aria-labelledby="new-client" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="new-client">New Client</h4>
                        </div>
                        <div class="modal-body">
                            <form id="client-form" method="post" class="new-client-container">
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-lname" class="control-label">Last Name</label>
                                        <input type="text" name="lname" class="form-control lname"/>
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-fname" class="control-label">First Name</label>
                                        <input type="text" name="fname" class="form-control fname"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 address-container">
                                        <label for="n-address" class="control-label">Address</label>
                                        <input type="text" class="form-control address-text address-1" name="address_1"/>
                                        <input type="text" class="form-control address-text address-2" name="address_2"/>
                                        <input type="text" class="form-control address-text address-3" name="address_3"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 email-container">
                                        <label for="n-email" class="control-label">Email Address</label>
                                        <input type="text" class="form-control email-text email-1" name="email_1"/>
                                        <input type="text" class="form-control email-text email-2" name="email_2"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 contact-no-container">
                                        <label for="n-contact-no" class="control-label">Contact No.</label>
                                        <input type="text" class="form-control contact-no-text contact-no-1" name="contact_no_1"/>
                                        <input type="text" class="form-control contact-no-text contact-no-2" name="contact_no_2"/>
                                        <input type="text" class="form-control contact-no-text contact-no-3" name="contact_no_3"/>
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                    <input type="submit" class="btn btn-primary btn-save" value="Save" />
                                </div>
                                <div class="clearfix"></div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <?php } ?>
            <!--View Client Modal-->
            <div class="modal fade" id="view-client-popup" tabindex="-1" role="dialog" aria-labelledby="view-client" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="view-client">View Client</h4>
                            <button class="btn btn-default btn-edit-client margin-top"><span class="glyphicon glyphicon-edit"></span> Edit</button>
                        </div>
                        <div class="modal-body">
                            <input type="hidden" name="client_id" id="client-id" />
                            <div class="view-client-container">
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Name</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="name"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Address</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="address"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Email Address</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="email"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Contact Number</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="contact"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <form id="client-edit-form" method="post" class="edit-client-container hide">
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-lname" class="control-label">Last Name</label>
                                        <input type="text" name="lname" class="form-control lname"/>
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-fname" class="control-label">First Name</label>
                                        <input type="text" name="fname" class="form-control fname"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 address-container">
                                        <label for="n-address" class="control-label">Address</label>
                                        <input type="text" class="form-control address-text address-1" name="address_1"/>
                                        <input type="text" class="form-control address-text address-2" name="address_2"/>
                                        <input type="text" class="form-control address-text address-3" name="address_3"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 email-container">
                                        <label for="n-email" class="control-label">Email Address</label>
                                        <input type="text" class="form-control email-text email-1" name="email_1"/>
                                        <input type="text" class="form-control email-text email-2" name="email_2"/>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 contact-no-container">
                                        <label for="n-contact-no" class="control-label">Contact No.</label>
                                        <input type="text" class="form-control contact-no-text contact-no-1" name="contact_no_1"/>
                                        <input type="text" class="form-control contact-no-text contact-no-2" name="contact_no_2"/>
                                        <input type="text" class="form-control contact-no-text contact-no-3" name="contact_no_3"/>
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                    <input type="submit" class="btn btn-primary btn-update" value="Update" />
                                </div>
                                <div class="clearfix"></div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <!--Delete Client Modal-->
            <?php if($con[3]==0){ ?>
            <div class="modal fade" id="delete-client-popup" tabindex="-1" role="dialog" aria-labelledby="delete-client" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="delete-client">Delete Client/s</h4>
                        </div>
                        <div class="modal-body">
                            <h4>Are you sure you want to delete the checked items?</h4>
                            <p><b>Note: </b>This action cannot be undone.</p>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default btn-no" data-dismiss="modal">No</button>
                            <button type="button" class="btn btn-primary btn-yes">Yes</button>
                        </div>
                  </div>
                </div>
            </div>
            <?php } ?>
        </div>
        <!--Supplier-->
        <div class="tab-pane" id="supplier-tab">
            <div class="container supplier-filter">
                <div class="row">
                    <?php if($con[0]==0){?>
                    <div class="col-md-2">
                        <div class="btn-group">
                            <a href="#new-supplier-popup" role="button" data-toggle="modal" 
                               data-backdrop="static" data-keyboard="false" class="btn btn-primary">
                                <span class="glyphicon glyphicon-plus"></span> New Supplier</a>
                        </div>
                    </div>
                    <?php } ?>
                    <?php if($con[3]==0){?>
                    <div class="col-md-2">
                        <a href="#delete-supplier-popup" class="btn btn-default btn-delete-supplier hide-element" data-toggle="modal" title="Delete Supplier/s">
                            <span class="glyphicon glyphicon-trash"></span> Delete
                        </a>
                    </div>
                    <?php }?>
                </div>
            </div>
            <div class="table-responsive">
                <table id="supplier-table" class="table table-bordered table-hover supplier-list">
                    <thead>  
                        <tr>  
                            <th style="width: 1%;"><input type="checkbox" class="check-all-supplier"/></th>
                            <th style="width: 12%;">Company Name</th>
                            <th style="width: 15%;">Contact Person</th>
                            <th style="width: 15%;">Service</th>
                            <th>Address</th>
                            <th style="width: 15%;">Email</th>
                            <th style="width: 10%;">Contact No.</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if($supplier === FALSE){?>
                        <?php }else{ ?>
                            <?php foreach ($supplier as $sup) {?>
                            <tr>
                                <td><input type="checkbox" class="item-supplier-checkbox" value="<?php echo $sup['supplier_id']?>"/></td>
                                <td><a href="#view-supplier-popup" class="btn-view-supplier" data-toggle="modal" 
                                       data-backdrop="static" data-keyboard="false"><?php echo $sup['company']?></a></td>
                                <td><?php echo $sup['contact_person']?></td>
                                <td><?php echo $sup['services']?></td>
                                <td><?php echo $sup['s_address']?></td>
                                <td><?php echo $sup['s_email']?></td>
                                <td><?php echo $sup['s_num']?></td>
                            </tr>
                            <?php } ?>
                        <?php } ?>
                    </tbody>  
                </table>
            </div>
            <!--New Supplier Modal-->
            <?php if($con[0]==0){?>
            <div class="modal fade" id="new-supplier-popup" tabindex="-1" role="dialog" aria-labelledby="new-supplier" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="new-supplier">New Supplier</h4>
                        </div>
                        <div class="modal-body">
                            <form id="supplier-form" method="post" class="new-supplier-container">
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-company" class="control-label">Company Name</label>
                                        <input type="text" name="cname" class="form-control cname" />
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-contact-person" class="control-label">Contact Person</label>
                                        <input type="text" name="contact_person" class="form-control contact-person" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 services-container">
                                        <label for="n-address" class="control-label">Services</label>
                                        <a href="#" class="another-services">Add row</a>
                                        <input type="text" class="form-control services-text services-1" name="services_1">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 address-container">
                                        <label for="n-address" class="control-label">Address</label>
                                        <input type="text" class="form-control address-text address-1" name="address_1">
                                        <input type="text" class="form-control address-text address-2" name="address_2">
                                        <input type="text" class="form-control address-text address-3" name="address_3">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 email-container">
                                        <label for="n-email" class="control-label">Email Address</label>
                                        <input type="text" class="form-control email-text email-1" name="email_1">
                                        <input type="text" class="form-control email-text email-2" name="email_2">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 contact-no-container">
                                        <label for="n-contact-no" class="control-label">Contact No.</label>
                                        <input type="text" class="form-control contact-no-text contact-no-1" name="contact_no_1">
                                        <input type="text" class="form-control contact-no-text contact-no-2" name="contact_no_2">
                                        <input type="text" class="form-control contact-no-text contact-no-3" name="contact_no_3">
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                    <input type="submit" class="btn btn-primary btn-save" value="Save"/>
                                </div>
                                <div class="clearfix"></div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <?php } ?>
            <!--View Supplier Modal-->
            <div class="modal fade" id="view-supplier-popup" tabindex="-1" role="dialog" aria-labelledby="view-supplier" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="view-supplier">View Supplier</h4>
                            <button class="btn btn-default btn-edit-supplier margin-top"><span class="glyphicon glyphicon-edit"></span> Edit</button>
                        </div>
                        <div class="modal-body">
                            <input type="hidden" name="supplier_id" id="supplier-id" />
                            <div class="view-supplier-container">
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Company Name</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="cname"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Contact Person</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="contact-person"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Services</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="services"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Address</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="address"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Email Address</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="email"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group">
                                        <label class="col-md-4 sm-col-6">Contact Number</label>
                                        <div class="col-md-8 sm-col-6">
                                            <span class="contact"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <form id="supplier-edit-form" method="post" class="edit-supplier-container hide">
                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label for="n-company" class="control-label">Company Name</label>
                                        <input type="text" name="cname" class="form-control cname" />
                                    </div>
                                    <div class="form-group col-sm-6">
                                        <label for="n-contact-person" class="control-label">Contact Person</label>
                                        <input type="text" name="contact_person" class="form-control contact-person" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 services-container">
                                        <label for="v-services" class="control-label">Services</label>
                                        <a href="#" class="another-services">Add row</a>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 address-container">
                                        <label for="n-address" class="control-label">Address</label>
                                        <input type="text" class="form-control address-text address-1" name="address_1">
                                        <input type="text" class="form-control address-text address-2" name="address_2">
                                        <input type="text" class="form-control address-text address-3" name="address_3">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 email-container">
                                        <label for="n-email" class="control-label">Email Address</label>
                                        <input type="text" class="form-control email-text email-1" name="email_1">
                                        <input type="text" class="form-control email-text email-2" name="email_2">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-12 contact-no-container">
                                        <label for="n-contact-no" class="control-label">Contact No.</label>
                                        <input type="text" class="form-control contact-no-text contact-no-1" name="contact_no_1">
                                        <input type="text" class="form-control contact-no-text contact-no-2" name="contact_no_2">
                                        <input type="text" class="form-control contact-no-text contact-no-3" name="contact_no_3">
                                    </div>
                                </div>
                                <div class="pull-right margin-top">
                                    <button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Cancel</button>
                                    <input type="submit" class="btn btn-primary btn-update" value="Update"/>
                                </div>
                                <div class="clearfix"></div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <!--Delete Supplier Modal-->
            <?php if($con[3]==0){?>
            <div class="modal fade" id="delete-supplier-popup" tabindex="-1" role="dialog" aria-labelledby="delete-supplier" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="delete-supplier">Delete Supplier</h4>
                        </div>
                        <div class="modal-body">
                            <h4>Are you sure you want to delete the checked items?</h4>
                            <p><b>Note: </b>This action cannot be undone.</p>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default btn-no" data-dismiss="modal">No</button>
                            <button type="button" class="btn btn-primary btn-yes">Yes</button>
                        </div>
                  </div>
                </div>
            </div>
            <?php } ?>
        </div>
    </div>
    <?php } ?>
</div>
